package com.tech.arno.spicy.staticVal;

import android.app.Application;

import com.tech.arno.spicy.share.ShareManager;
import com.umeng.analytics.MobclickAgent;

import cn.jpush.android.api.JPushInterface;

/*
*   package:     com.tech.arno.spicy.application
*   fileName:    SpicyApplication
*   author:    ArnoFrost
*   date:  2017/12/6 0006 16:48
*   desc:     Application文件
*/

public class SpicyApplication extends Application {

    private static SpicyApplication mApplication = null;

    @Override
    public void onCreate() {
        super.onCreate();
        mApplication = this;
        //ShareSDK初始化
        initShareSDK();
        //极光初始化
        initJPush();
        //初始化友盟
        initUMeng();
    }

    private void initUMeng() {
        MobclickAgent.setDebugMode(true);
        MobclickAgent.openActivityDurationTrack(false);
    }

    //ShareSDK初始化
    private void initShareSDK() {
        //填写您从Mob开发者后台中得到的Appkey和AppSecret
        ShareManager.initSDK(this, "232051ca4c432", "c5d1d37c47e483ae0653e0f228dfb71b");
    }

    //极光初始化
    private void initJPush() {
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);
    }

    public static SpicyApplication getInstance() {
        return mApplication;
    }
}
